<template>
    <div>
        <van-nav-bar title="首页  关注" left-text="返回" left-arrow @click-left="onClickLeft" />
        <van-search v-model="value" placeholder="请输入搜索关键词" @click="bth"/>
        <van-tabs v-model:active="active">
            <van-tab title="标签 1"></van-tab>
            <van-tab title="标签 2"></van-tab>
            <van-tab title="标签 3"></van-tab>
            <van-tab title="标签 4"></van-tab>
        </van-tabs>
        <van-swipe :autoplay="3000" lazy-render>
            <van-swipe-item v-for="image in images" :key="image">
                <img :src="image" style="width: 100%;height: 200px;" />
            </van-swipe-item>
        </van-swipe>
        <van-grid :column-num="4">
            <van-grid-item v-for="value in catitems" :icon="value.image_src" :text="value.name" />
        </van-grid>
        <van-grid :column-num="4">
            <van-grid-item v-for="value in catitems" :icon="value.image_src" :text="value.name" />
        </van-grid>
        <div class="wen">
            <div style="width: 100%;height: 150px;background: salmon;">
                <img src="../../img/4566.jpg" alt="">
            </div>
            <div style="width: 100%;height: 170px;background: salmon;">
                 <img src="../../img/4566.jpg" alt="">
            </div>
            <div style="width: 100%;height: 230px;background: salmon;">
                 <img src="../../img/4566.jpg" alt="">
            </div>
            <div style="width: 100%;height: 165px;background: salmon;">
                 <img src="../../img/4566.jpg" alt="">
            </div>
        </div>
    </div>
</template>

<script setup>
const images = [
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-3.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-4.jpeg',
];
import { ref } from 'vue';
import { catitemsApi } from '@/api/api'
import { useRouter } from 'vue-router';
let router=useRouter()
let catitems = ref([])
catitemsApi().then(res => {
    console.log('导航数据', res);
    catitems.value = res.data.message
})
let bth=()=>{
    router.push('/ss')
}
</script>

<style lang="scss" scoped>
.wen {
    column-count: 2px;
    column-gap: 20px;
 div {
     border: 1px solid #000;
        img {
            width: 100%;
            height: 110px;
           
        }
    }

}
</style>